package com.bjpowernode.crm.settings.service.impl;

import com.bjpowernode.crm.commons.utils.UUIDUtils;
import com.bjpowernode.crm.settings.domain.DicValue;
import com.bjpowernode.crm.settings.mapper.DicValueMapper;
import com.bjpowernode.crm.settings.service.DicValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 郭俊才
 * 2021/8/20
 */
@Service
public class DicValueServiceImpl implements DicValueService {
    @Autowired
    private DicValueMapper dicValueMapper;
    @Override
    public int save(DicValue dicValue) {
        dicValue.setId(UUIDUtils.getUUID());
        return dicValueMapper.insert(dicValue);
    }

    @Override
    public int removeByPrimaryKey(String[] ids) {
        return dicValueMapper.deleteByPrimaryKey(ids);
    }

    @Override
    public int editByPrimaryKey(DicValue record) {
        return dicValueMapper.updateByPrimaryKey(record);
    }

    @Override
    public DicValue queryByPrimaryKey(String id) {
        return dicValueMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<DicValue> queryByTypeCode(String typeCode) {
        return dicValueMapper.selectByTypeCode(typeCode);
    }

    @Override
    public List<DicValue> queryAll() {
        return dicValueMapper.selectAll();
    }
}
